extends ../layout

block content
	.video-box
		if movie.video.indexOf('.mp4') > 0
			video(src="#{movie.video}", allowFullScreen="true", controls="controls", width="100%" height="500", align="middle")
		else
			embed(src="#{movie.video}", allowFullScreen="true", width="100%" height="500", align="middle", type="application/x-shockwave-flash")
	.container
		.row
			.col-md-7
				.comment-box
					.comment-title
						h4 评论
					.comment-body
						ul.media-list
							each item in comments
								li.media
									.pull-left
										a.comment(href="#comments", data-cid="#{item._id}", data-tid="#{item.from._id}")
											img.media-object.img-circle(src="http://img.mukewang.com//54584ef20001deba02200220.jpg", style="width: 56px; height: 56px;")
									.media-body
										h4.media-heading #{item.from.name}
										p #{item.content}
										small.text-muted 时间：#{moment(item.meta.updateAt).format('YYYY-MM-DD')}
										if item.reply && item.reply.length > 0
											each reply in item.reply
												.media
													.pull-left
														a.comment(href="#comments", data-cid="#{item._id}", data-tid="#{reply.from._id}")
															img.media-object.img-circle(src="http://img.mukewang.com//545861f00001be3402200220.jpg", style="width: 48px; height: 48px;")
													.media-body
														h4.media-heading 
															| #{reply.from.name}
															span.text-info &nbsp;回复&nbsp;
															| #{reply.to.name}：
														p #{reply.content}
									hr
							#comments
								form#commentForm(method="POST", action="/user/comment")
									input(type="hidden", name="comment[movie]", value="#{movie._id}")
									if user
										input(type="hidden", name="comment[from]", value="#{user._id}")
									.form-group
										textarea.form-control(name="comment[content]", row="3", placeholder="扯淡，吐槽，表扬，，，留下你的想法！")
									if user
										button.btn.btn-primary.pull-right(type="submit") 发表评论
									else
										a.navbar-link(href="#", data-toggle="modal", data-target="#signinModal") 登录后评论
			.col-md-5
				.comment-box
					.comment-title
						h4 电影详情
					blockquote
						p.block-style 电影评分
							i  #{movie.average}
					dl.dl-horizontal.text-style
						dt 电影名字
						dd= movie.title					
						dt 导演
						dd= movie.doctor
						dt 国家
						dd= movie.country
						dt 语言
						dd= movie.language
						dt 上映年份
						dd= movie.year
						dt 简介
						dd= movie.summary
	script(src="/js/detail.js")



